{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "#programming_fever\n",
    "#objectTracking\n",
    "#in this code I tried to extract blue color object\n",
    "import cv2 \n",
    "import numpy as np  \n",
    "cap = cv2.VideoCapture(0) \n",
    "while(1): \n",
    "    _,frame = cap.read() \n",
    "    hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) \n",
    "    lower_blue = np.array([110, 50, 50]) \n",
    "    upper_blue = np.array([130, 255, 255]) \n",
    "    mask = cv2.inRange(hsv, lower_blue, upper_blue) \n",
    "    result = cv2.bitwise_and(frame, frame, mask = mask) \n",
    "    cv2.imshow('frame', frame) \n",
    "    cv2.imshow('mask', mask) \n",
    "    cv2.imshow('result', result) \n",
    "    k= cv2.waitKey(1)& 0XFF\n",
    "    if k==27:\n",
    "        break\n",
    "cv2.destroyAllWindows() \n",
    "cap.release() "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
